<?php

namespace App\Validators\Student;

use App\Validators\PassesValidator;
use \Prettus\Validator\Contracts\ValidatorInterface;
use \Prettus\Validator\LaravelValidator;

class StudentRelationValidator extends LaravelValidator
{
    use PassesValidator;
    protected $rulesMessages=[
        'student_id.required' => '学生ID是必填的',
        'relation_name.required' => '与学生关系是必填的',
        'name.required'  => '姓名是必填的',
        'phone.required'  => '电话是必填的',
        'company.required'  => '工作单位是必填的',
    ];
    protected $rules = [
        ValidatorInterface::RULE_CREATE => [
            'student_id'=>'required',
            'relation_name'=>'required',
            'name'=>'required',
            'phone'=>'required',
            'company'=>'required',
        ],
        ValidatorInterface::RULE_UPDATE => [],
   ];
}
